<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%settings}}".
 *
 * @property int $id
 * @property string $option_name 标题
 * @property string $option_key 键
 * @property string $option_val 值
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 * @property int $deleted 标记删除
 */
class Settings extends \common\models\BaseModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%settings}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['option_name', 'option_val'], 'required'],
            [['option_val'], 'string'],
            [['created_at', 'updated_at', 'deleted'], 'integer'],
            [['option_name'], 'string', 'max' => 20],
            [['option_key'], 'string', 'max' => 40],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'option_name' => '标题',
            'option_key' => '键',
            'option_val' => '值',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'deleted' => '标记删除',
        ];
    }
}
